package org.JieKou;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Fw {
    public static void main(String[] args) {
        try (BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"))) {
            writer.write("Hello, world!");
            writer.write("This is a new line.");
        } catch (IOException e) {
            System.out.println("写入文件出错: " + e.getMessage());
        }
    }
}
